<template>
	<view>
		<Header>
			会议活动
		</Header>
		<uni-list v-show="data.length > 0">
			<uni-list-item direction="row" v-for="item in data" :key="item.id"  :to="`/pages/resumption/meetingContent?id=${item.id}&type=1`">
				<template v-slot:body>
					<view class="uni-list-box uni-content">
						<view class="title uni-ellipsis-2">
							{{item.title}}
						</view>
						<view class="bottom">
							<span style="margin-right: 20px;">发布时间：{{item.createtime_text}}</span>
							<span>发布来源：{{item.launch}}</span>
						</view>
					</view>
				</template>
			</uni-list-item>
		</uni-list>
		<uni-load-more v-if="showLoad" :status="loadStatus" />
		<image src="https://zhzx.on-line-demo.com/image/zwsj.png" mode="aspectFit" class="no-data" v-if="loadStatus == 'no-more' && data.length == 0"></image>
	</view>
</template>

<script>
	import request from '../../common/request.js'
	import Header from '../../components/header.vue'
	export default {
		components: {
			Header
		},
		data() {
			return {
				seatList:[],
				data:[],
				page: 1,
				loadStatus: 'loading',
				showLoad: false,
			}
		},
		mounted(){
			this.getListData()
		},
		onReachBottom() {
			if (this.loadStatus != 'loading') {
				this.loadStatus = 'loading'
				this.showLoad = true
				this.page++
				this.getListData()
			}
		},
		methods: {
			getListData(){
				request({
					url:'/meeting/meetList',
					data:{
						page: this.page,
						meetype:2
					},
					method:'POST',
				}).then(res => {
						if(res.code == 1){
							this.data = this.data.concat(res.data)
							if(this.page == res.lastPage || res.lastPage == 0){
								this.loadStatus = 'no-more'
							}else{
								this.loadStatus = 'more'
								this.showLoad = false
							}
						}else{
							this.loadStatus = 'no-more'
						}
					})
			},
		}
	}
</script>

<style scoped>
	.bottom {
		font-size: 12px;
	}
	.bottom span,
	.bottom label{
		display: inline-block;
	}
</style>